package Dao;

import java.sql.Connection;
import java.util.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class InsertdateDao extends BaseDao {
	public void insert (String a,String h,String b,Date c,String d,String e,String f,String g){
		Connection con=this.getconnection();
		PreparedStatement ps= null;
		ResultSet rs=null;
		try {		
			String sql="insert into person_information(Pname,sex,age,birthday,telephone,birthaddress,occupation,unit) " +
					"values (?,?,?,?,?,?,?,?)";
			ps=con.prepareStatement(sql);
			java.sql.Date date = new java.sql.Date(c.getTime());
			ps.setString(1, a);
			ps.setString(2, h);
			ps.setString(3, b);
			ps.setDate(4, date);
			ps.setString(5, d);
			ps.setString(6, e);
			ps.setString(7, f);
			ps.setString(8, g);
			ps.execute();
		} catch (SQLException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}finally{
			this.close(con, ps, rs);
		}
	
	}
}
